mui.init({
	swipeBack: false
});

mui.plusReady(function() {
	plus.screen.lockOrientation("portrait-primary");

	var backButtonPress = 0;
	mui.back = function() {
		backButtonPress++;
		if(backButtonPress > 1) {
			plus.runtime.quit();
		} else {
			plus.nativeUI.toast('再按一次退出应用');
		}
		setTimeout(function() {
			backButtonPress = 0;
		}, 1000);
	}

	mui('.mui-bar-tab').on('tap', 'a', function(e) {
		var targetTab = this.getAttribute('id');
		
		if(targetTab == 'mall/index_m.html'){
			mui.openWindow({
			id: 'mallindex_m',
			url: 'mall/index_m.html',
			createNew: true,
			show: {
				aniShow: 'fade-in'
			},
			waiting: {
				autoShow: true
			}
		});
		}else{
			mui.openWindow({
			id: targetTab,
			url: targetTab,
			createNew: true,
			show: {
				aniShow: 'fade-in'
			},
			waiting: {
				autoShow: true
			}
		});
		}
		

	});

})